package model;

import java.util.ArrayList;
import java.util.List;

import model.Description;
import model.Ressource;

public class Entity {

	protected int id;
	protected String name;
	protected Description description;
	protected List<Ressource> ressources;
	
	public Entity(){
		this.name = "Default";
		this.ressources = new ArrayList<Ressource>();
	}
	
	public Entity(String name)
	{
		this.name = name;
		this.ressources = new ArrayList<Ressource>();
	}
	
	public void addRessource(Ressource r)
	{
		this.ressources.add(r);
	}
	
	public Ressource ressource(String name)
	{
		return this.ressource(name);
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Description getDescription() {
		return description;
	}

	public void setDescription(Description description) {
		this.description = description;
	}

	public List<Ressource> getRessources() {
		return ressources;
	}

	public void setRessources(List<Ressource> ressources) {
		this.ressources = ressources;
	}

	public boolean removeRessource(String name)
	{
		return this.ressources.remove(name) != false;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
}
